package org.iabako.shared.querydefinition.columndefinition;

import org.iabako.client.tools.Messages;
import org.iabako.shared.querydefinition.dto.QueryResultValueType;

import java.io.Serializable;

/**
 * TODO javadoc
 * Date: 24/11/13
 * Time: 18:22
 */
public enum ClientColumnEnum implements ColumnDefinition, Serializable {

    number("client.number", null, "result_table_client_number", "columnSminus columnleftalign smalltable", QueryResultValueType.STRING, 3000, false),
    name("client.name", null, "result_table_client_name", "columnMplus", QueryResultValueType.STRING, 8000, false),
    email("client.email", null, "result_table_client_email", "columnMplus", QueryResultValueType.STRING, 6000, false),
    address1("client.address.addressLine1", null, "result_table_client_addressLine1", "columnM smalltable", QueryResultValueType.STRING, 8000, false),
    phoneNumber1("client.phoneNumber1", null, "result_table_client_phoneNumber1", "columnS", QueryResultValueType.STRING, 3000, false),
    status("client.status", null, "result_table_status_column", "columnSminus columncenteralign", QueryResultValueType.ENUM, 4000, false),

    //to filter in ClientSearch
    conversationStatus("conversation.status", "left outer join client.conversations conversation", null, null, null, 0, false),
    disabled("client.disabled", null, "result_table_disabled_column", null, QueryResultValueType.BOOLEAN, 3000, true),

    //to filter with suggest field
    clientId("client.id", null, null, null, null, 0, false),

    //default filter with user session
    clientEnterprise("client.enterprise", null, null, null, null, 0, false),

    //to show in excel export
    gender("client.gender", null, "result_table_excel_client_gender", null, QueryResultValueType.ENUM, 4000, true),
    birthday("client.birthday", null, "result_table_excel_client_birthday", null, QueryResultValueType.DATE, 3000, true),
    address2("client.address.addressLine2", null, "result_table_excel_client_addressLine2", null, QueryResultValueType.STRING, 5000, true),
    addressCity("client.address.city", null, "result_table_excel_client_city", null, QueryResultValueType.STRING, 3000, true),
    phoneNumber2("client.phoneNumber2", null, "result_table_excel_client_phoneNumber2", null, QueryResultValueType.STRING, 3000, true),

    //For notification details use
    birthdayDay("day(client.birthday)", null, null, null, null, 0, false),
    birthdayMonth("month(client.birthday)", null, null, null, null, 0, false);


    private String hqlDefinition;
    private String hqlJoin;
    private String labelKey;
    private String className;
    private QueryResultValueType queryResultValueType;
    private int excelColumnWidth;
    private boolean onlyInExcelExport;

    ClientColumnEnum(String hqlDefinition, String hqlJoin, String labelKey, String className, QueryResultValueType queryResultValueType, int excelColumnWidth, boolean onlyInExcelExport) {
        this.hqlDefinition = hqlDefinition;
        this.hqlJoin = hqlJoin;
        this.labelKey = labelKey;
        this.className = className;
        this.queryResultValueType = queryResultValueType;
        this.excelColumnWidth = excelColumnWidth;
        this.onlyInExcelExport = onlyInExcelExport;
    }

    public String getHqlDefinition() {
        return hqlDefinition;
    }

    public String getHqlJoin() {
        return hqlJoin;
    }


    public String getLabel() {
        return Messages.getLabel(labelKey);
    }

    public String getLabelKey() {
        return labelKey;
    }

    public int getExcelColumnWidth() {
        return excelColumnWidth;
    }

    public boolean isOnlyInExcelExport() {
        return onlyInExcelExport;
    }

    public String getClassName() {
        return className;
    }

    public String getIconClassName() {
        return null;
    }

    public String getIconClassNameEmpty() {
        return null;
    }

    public String getTextEmpty() {
        return null;
    }

    public QueryResultValueType getQueryResultValueType() {
        return queryResultValueType;
    }


}
